//
//  Extension.swift
//  myWeibobo
//
//  Created by MrWu on 16/4/7.
//  Copyright © 2016年 MrWu. All rights reserved.
//

import UIKit

class Extension: UIButton {

    convenience init(imageNamed:String,backImageNamed:String) {
        self.init()
        setImage(UIImage(named: imageNamed), forState: UIControlState.Normal)
        setImage(UIImage(named: imageNamed + "_highlighted"), forState: UIControlState.Highlighted)
        setBackgroundImage(UIImage(named: backImageNamed), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: backImageNamed + "_highlighted"), forState: UIControlState.Highlighted)
        
        self.sizeToFit()
    }

}
